package com.example.producer.service;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class DirectService{
    @Autowired
    private AmqpTemplate rabbitTemplate;

    public void send(String name) {
        System.out.println("队列名：hello; 内容：hello,rabbit~");
        rabbitTemplate.convertAndSend("hello","hello,rabbit~");
    }

}